<?php
require_once('common/header.php'); 
?>
<style>
    .page-title-bar { padding: 1rem; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; background-color: #fff;}
    .page-title-bar .back-btn { font-size: 1.5rem; color: #333; text-decoration: none; margin-right: 1rem;}
    .page-title-bar h4 { margin: 0; font-weight: 600; }
</style>

<div id="password-app" v-cloak>
    <div class="page-title-bar">
        <a href="profile.php" class="back-btn"><i class="bi bi-arrow-left"></i></a>
        <h4>修改密码</h4>
    </div>

    <div class="main-content">
        <div class="card">
            <div class="card-body">
                <div id="alert-container-password" class="my-3"></div>
                <form id="password-form" @submit.prevent="changePassword">
                    <div class="mb-3">
                        <label class="form-label fw-bold">旧密码</label>
                        <input type="password" class="form-control form-control-lg" v-model="form.old_password" placeholder="请输入您的当前密码" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label fw-bold">新密码</label>
                        <input type="password" class="form-control form-control-lg" v-model="form.new_password" placeholder="8位以上，需包含字母和数字" required>
                    </div>
                    <div class="mb-4">
                        <label class="form-label fw-bold">确认新密码</label>
                        <input type="password" class="form-control form-control-lg" v-model="form.confirm_password" placeholder="请再次输入新密码" required>
                    </div>
                    <button type="submit" class="btn btn-primary w-100 btn-lg" :disabled="isSubmitting">
                        {{ isSubmitting ? '正在提交...' : '确认修改' }}
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>

<?php require_once('common/footer.php'); ?>